package com.hanggold.lambda;

import java.util.stream.Stream;

public class ReduceDemo {

    public static void main(String[] args) {

        int sum  = Stream.of(1,2,3,4,5,6,7,8,9,10).reduce(0,(r,a)->r+a);

        System.out.println(sum);

        Stream.of(1,2,3,4,5,6,7,8,9,10).reduce(Integer::sum).ifPresent(System.out::println);


//        Stream.of(1,2,3,4,5,6,7,8,9,10).reduce()



    }


}
